package com.nelson.musicplayer.manager

import com.nelson.musicplayer.constant.SERVER
import com.nelson.musicplayer.source.api.HomeService
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory


/**
 * @author nelson
 * @since 2020-07-27
 */
object RequestManager {
    private val mRetrofit: Retrofit = Retrofit.Builder()
        .baseUrl("$SERVER/") //设置网络请求的Url地址
        .addConverterFactory(GsonConverterFactory.create()) //设置数据解析器
        .build()

    fun createHomeService(): HomeService = mRetrofit.create(
        HomeService::class.java
    )
}